package com.toogu.mazhangmen.ui.main;

import android.view.View;
import android.widget.AdapterView;

import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
import com.toogu.mazhangmen.bean.EquipmentsBean;
import com.toogu.mazhangmen.ui.view.RadioGroupView;
import com.toogu.mazhangmen.ui.view.SearchView;

import java.util.List;

public interface MainContract {
    interface IView {
        void onCreate();//创建Activity的界面

        void onResume();

        void onPause();

        void onDestory();

        void setViewDelegate(IView.Delegate viewDelegate);//设置回调

        void onSearch();

        void onRadioGroup();

        void onSpinner(int position);
        //更新界面
        void showNewViewPager(List<EquipmentsBean> equipmentsBeanList);

        void setSpinnerDate(String[] ProjectName);

        void notify(EquipmentsBean equipmentsBean);

        void showWaiting();

        void hideWaiting();

        interface Delegate {
            View.OnClickListener getViewOnClickListener();

            SearchView.OnClickListener getSearchViewOnClickListener();

            RadioGroupView.OnCheckedChangeListener getRadioGroupViewOnCheckedChangeListener();

            OnRefreshLoadMoreListener getOnRefreshLoadMoreListener();

            AdapterView.OnItemSelectedListener getAdapterViewOnItemSelectedListener();
        }

    }

    interface IModel {
        void onCreate();

        void onResume();

        void onPause();

        void onDestory();//用于切断网络链接等等

        //设置回调实例
        void setModelDelegate(IModel.Delegate modelDelegate);

        void getEquipment(int MODE, String search);

        void getProject(int position);

        interface Delegate {
            void onDataChanged(List<EquipmentsBean> equipmentsBeanList);

            void onSetProjectList(String[] ProjectName);

            void onHideWaiting();
        }
    }

    interface IPresenter {
        void onCreate(IView view, IModel model);

        void onResume();

        void onPause();

        void onDestory();//在Activity中调用，实现view和model的onDestory
    }
}
